home *** CD-ROM | disk | FTP | other *** search
- -- card: 5678 from stack: in
- -- bmap block id: 0
- -- flags: 0000
- -- background id: 2624
- -- name: Chat
- ----- HyperTalk script -----
- on openCard
- global keybuff
- global foundSoFar
- put empty into foundSoFar
- configureSPort lineFeedOn,echoOn
- put "Type shift-6 (^) to exit chat..." into it
- put it & return & return into cd field "Chat"
- sendString return & return & return & it & return & return
- play "chat"
- put empty into keybuff
- end openCard
-
- on idle
- global foundSoFar
- get recvUpTo(return,10,foundSoFar)
- -- get recvChars(charsAvailable())
- if it is not empty then put it after cd fld "Chat"
- if it contains "^" then exitChat
- else if it contains "NO CARR" then
- put "Connection broken!"
- exitChat
- end if
- end idle
-
- on keydown whichkey
- global keybuff
- get whichkey
- if it is numToChar(8) then
- put empty into last char of keybuff
- else if it is "^" then exitChat
- else
- put it after keybuff
- if it is then beep 1
- else
- if (charToNum(it) < 65) or (charToNum(it) > 122) then
- put keybuff after cd field "Chat"
- sendString keybuff
- put empty into keybuff
- end if
- end if
- end if
- end keydown
-
- on exitChat
- beep 1
- sendVanilla "Chat ending... "
- pop card
- end exitChat
-
-
- -- part 1 (field)
- -- low flags: 04
- -- high flags: 0007
- -- rect: left=0 top=0 right=342 bottom=512
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 203
- -- text size: 9
- -- style flags: 0
- -- line height: 12
- -- part name: Chat
-
-
- -- part contents for card part 1
- ----- text -----
- Type shift-6 (^) to exit chat...
-
-